<?php
class ControllerCheck extends Controller {
	public function __construct($q) {
		parent::__construct($q);
	}
	
	public function execute() {
		if(count($this->getQueryRaw()) == 0)
			View::show("Usage : check domain ...");
		while($v = $this->getQuery())
			View::show("[+] Checking '$v': ".($this->doCheck($v) ? 'already registered' : 'available'));
	}
	
	private function doCheck($n) {
		return checkdnsrr($n);
	}
}